package com.smasher.bluetooth.fragment;

import android.annotation.SuppressLint;
import android.bluetooth.BluetoothDevice;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;

import com.smasher.bluetooth.R;
import com.smasher.widget.base.BaseRecyclerViewHolder;

public class DeviceViewHolder extends BaseRecyclerViewHolder<BluetoothDevice> {

    private AppCompatTextView mName;

    public DeviceViewHolder(@NonNull View itemView) {
        super(itemView);
        mName = itemView.findViewById(R.id.name);
    }

    @SuppressLint("MissingPermission")
    @Override
    public void bindView() {
        super.bindView();
        String address = mItem.getAddress();
        String show = String.format("%s\n(%s)", mItem.getName(), address);
        mName.setText(show);
    }
}
